///*
// * Copyright (C) 2014 VenomVendor <info@VenomVendor.com>
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// *     http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// *
// */
//
//package com.naizhuai.ui.adapter.business;
//
//import android.content.Context;
//import android.support.annotation.NonNull;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.TextView;
//
//import com.bumptech.glide.Glide;
//import com.naizhuai.R;
//
//import java.io.File;
//import java.util.List;
//
//public class ActionDoingDataAdapterHolder extends RecyclerView.Adapter {
//
//    private OnItemClickListener mItemClickListener;
//    private Context mContext;
//    private List<String> filePathStrs;
//
//    public static final int ITEM_IMAGE_CONTENT=0;
//    public static final int ITEM_ADD_ICON=1;
//
//
//    public ActionDoingDataAdapterHolder(Context context, List<String> filePathStrs) {
//        this.mContext = context;
//        this.filePathStrs=filePathStrs;
//    }
//
//
//    /**
//     * 设置不同的类型：
//     * 0：表示展示的title的item
//     * 1：展示的item内容
//     * @param position
//     * @return
//     */
//    @Override
//    public int getItemViewType(int position) {
//        if(position<filePathStrs.size())
//            return ITEM_IMAGE_CONTENT;
//        else
//            return ITEM_ADD_ICON;
//    }
//
//
//    @Override
//    public int getItemCount() {
//        return filePathStrs.size()+1;
//    }
//
//    @NonNull
//    @Override
//    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent , int viewType) {
//        if(viewType==0) {
//            View sView = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_action_image_details, parent, false);
//            return new ActionImageItemHolder(sView);
//        }else{
//            View sView = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_action_image_details_add, parent, false);
//            return new ActionAddItemHolder(sView);
//        }
//    }
//
//
//    @Override
//    public void onBindViewHolder(RecyclerView.ViewHolder holder , int position) {
//        if(holder instanceof ActionImageItemHolder){
//            ActionImageItemHolder imageHolder= (ActionImageItemHolder) holder;
//            String filePath=filePathStrs.get(position);
//            File file=new File(filePath);
//            Glide.with(mContext).load(file)
//                    .placeholder(R.mipmap.ic_launcher).error(R.mipmap.ic_launcher)
//                    .into( imageHolder.image);
//        }else if(holder instanceof ActionAddItemHolder){
//            ActionAddItemHolder addHolder= (ActionAddItemHolder) holder;
//        }
//    }
//
//
//    public class ActionImageItemHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
//        ImageView image;
//
//        public ActionImageItemHolder(View view) {
//            super(view);
//            image = (ImageView) view.findViewById(R.id.image_details);
//            view.setOnClickListener(this);
//        }
//
//        @Override
//        public void onClick(View v) {
//            mItemClickListener.onItemClick(v,getAdapterPosition(),ITEM_IMAGE_CONTENT);
//        }
//    }
//
//
//
//    public class ActionAddItemHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
//        ImageView imageAdd;
//        TextView imageAddTxt;
//
//        public ActionAddItemHolder(View view) {
//            super(view);
//            imageAdd=view.findViewById(R.id.image_add);
//            imageAddTxt=view.findViewById(R.id.image_add_txt);
//            view.setOnClickListener(this);
//        }
//
//        @Override
//        public void onClick(View v) {
//            mItemClickListener.onItemClick(v,getAdapterPosition(),ITEM_ADD_ICON);
//        }
//    }
//
//
//    public interface OnItemClickListener {
//        void onItemClick(View view, int position, int indexType);
//    }
//
//    public void setOnItemClickListener(OnItemClickListener mItemClickListener) {
//        this.mItemClickListener = mItemClickListener;
//    }
//
//    public interface OnItemLongClickListener {
//        void onLongItemClick(View view, int position);
//    }
//
//}
